﻿/**
 * Plugin that is used for hard hyphenation of text that doesn't fit to the
 * width of the wrapper component. A word breaking characters are injected in
 * the text in order to force browser to make hyphenation.
 * 
 * @autor SVelikov
 */
Hyphenation = {

	/**
	 * Letter-spacing in pixels.
	 */
	LETT_SPACE :0,

	/**
	 * Hyphen character provided trough constructor.
	 */
	HYPHEN_TYPE :'',

	/**
	 * Hyphen's width that is set in constructor.
	 */
	HYPHEN_TYPE_WIDTH :0,

	/**
	 * Selector for the elements to be processed.
	 */
	SELECTOR :'',

	/**
	 * Constant for the '<' character that is to be escaped when the text is
	 * written back to document.
	 */
	OPEN_TAG_ENTITY :'&#60;',

	/**
	 * Object literal containing hyphen types.
	 */
	HYPHEN_TYPES : {
		h :'<wbr>',
		s :'&shy;',
        n :'\n'
	},

	/**
	 * Object literal containing hyphen widths.
	 */
	HYPHEN_WIDTHS : {
		h :0,
		s :7,
        n :0
	},

	/**
	 * Object literal containing word breaking chars.
	 */
	WBR_CHARS : {
		'-' :0,
		' ' :1
	},

	/**
	 * Main method called on page load. Finds all the required elements using
	 * jQuery and calls a checkContent to process the found elements if any.
	 * Argument hyphenType has 2 possible values 'H' - for hard hyphenation
	 * using <wbr> (zero width space) tag and 'S' - for soft hyphenation using
	 * &shy; that inserts an hyphen char '-' where it is situated in the text.
	 * The selector argument is also required as it is used for the api to know
	 * on which elements to apply hyphenation algorithm.
	 * 
	 * @param hyphenType
	 *            to be used for the hyphenation
	 * @param selector
	 *            the selector to be used when search for elements to process
	 */
	run : function(hyphenType, selector) {
		console.log('script invoked!');
		if (hyphenType) {
			hyphenType = hyphenType.toLowerCase();
			if (hyphenType in this.HYPHEN_TYPES) {
				this.HYPHEN_TYPE = this.HYPHEN_TYPES[hyphenType];
				this.HYPHEN_TYPE_WIDTH = this.HYPHEN_WIDTHS[hyphenType];
			}
		} else {
			return;
		}

		if (selector !== null || selector !== undefined) {
			if (selector.length === undefined) {
				var selectorObj = selector;
				for (selector in selectorObj) {
					this.findAndFix(selectorObj[selector]);
				}
			} else {
				this.findAndFix(selector);
			}
		} else {
			return;
		}
	},

	/**
	 * Finds all elements matched by the provided selector using jQuery. If
	 * found any elements they are processed.
	 * 
	 * @param selector
	 *            any allowed from jQuery selector (css class, id, tag name and
	 *            so on)
	 */
	findAndFix : function(selector) {
		var currentFontSize = this.getFontSize(document.body);
		this.prepareCharWidths(currentFontSize * 1);
        console.log('font-size: ' + currentFontSize);
		var previewElements = jQuery(selector);
		if (previewElements.length > 0) {
			this.checkContent(previewElements);
		}
	},

	/**
	 * Iterates the provided array and for every element there calculates the
	 * elements width in pixels and calls method to hyphenate the text if needed
	 * providing the width of the element and the text itself.
	 */
	checkContent : function(previewElements) {
		var len = previewElements.length;
		var currentCell, txt, eleWidth, fixedString;
		for ( var i = 0; i < len; i++) {
			currentCell = previewElements[i];
			txt = jQuery(currentCell).html();

			// get the width in pixels of the current element
			eleWidth = currentCell.offsetWidth;
			
			if (currentCell.tagName == 'PRE') {
				fixedString = this.breakStringInPre(txt, eleWidth
						- this.HYPHEN_TYPE_WIDTH);
			} else {
				// call the method to hyphenate the text if needed
				fixedString = this.breakString(txt, eleWidth
						- this.HYPHEN_TYPE_WIDTH);
			}			

			// put back the returned string into its container element
			// THIS IS WORKAROUND FOR IE BUG SEE FOR DETAILS:
			// http://www.quirksmode.org/bugreports/archives/2004/11/innerhtml_and_t.html
			if (currentCell.tagName == 'PRE' && 'outerHTML' in currentCell) {
				var outer = currentCell.outerHTML;
				var currentCellAttributes = outer.substring(4, outer
						.indexOf('>'));
				console.log('attr: ' + currentCellAttributes);
				currentCell.outerHTML = '<PRE ' + currentCellAttributes + '>'
						+ fixedString + '</PRE>';
			} else {
				currentCell.innerHTML = fixedString;
			}
		}
	},

	breakStringInPre : function(txt, eleWidth) {
		var txtArr = txt.split('');
		var txtLength = txtArr.length;
		var resultStr = [];
		var resultStrCount = 0;
		var sum = 0;
		var ch;
		var lastLFid = -1;
		var space = ' ';
		var newLine = '\n';
		for ( var i = 0; i < txtLength; i++) {
			ch = txtArr[i];

			if (ch == space) {
				lastLFid = i;
			}

			if (ch.charCodeAt(0) == 60) {
				if ((txt.charCodeAt(i + 1) == 98 || txt.charCodeAt(i + 1) == 66)
						&& (txt.charCodeAt(i + 2) == 62)) {
					i += 2;
					resultStr += '<b>';
					continue;
				} else if ((txt.charCodeAt(i + 1) == 47)
						&& (txt.charCodeAt(i + 2) == 98 || txt
								.charCodeAt(i + 2) == 66)
						&& (txt.charCodeAt(i + 3) == 62)) {
					i += 3;
					resultStr += '</b>';
					continue;
				} else if ((txt.charCodeAt(i + 1) == 87 || txt
						.charCodeAt(i + 1) == 119)
						&& (txt.charCodeAt(i + 2) == 98 || txt
								.charCodeAt(i + 2) == 66)
						&& (txt.charCodeAt(i + 3) == 82 || txt
								.charCodeAt(i + 3) == 114)
						&& (txt.charCodeAt(i + 4) == 62)) {
					i += 4;
					resultStr += '<wbr>';
					continue;
				}
			}

			if (ch == newLine) {
				sum = 0;
			} else {
				var increment = this.allSigns[ch.charCodeAt(0) - 32]
						+ this.LETT_SPACE;
				if ((sum + increment) >= eleWidth) {

					if (lastLFid > -1) {
						resultStr[lastLFid] = newLine;
					}
					if (lastLFid == -1) {
						resultStr[resultStrCount] = newLine;
						resultStrCount++;
					}
					lastLFid = -1;
					sum = 0;                    
				}

				if (ch.charCodeAt(0) >= 32 && ch.charCodeAt(0) <= 1103) {
					sum += increment;
				}
			}
			resultStr[resultStrCount] = ch;
			resultStrCount++;
		}
		return resultStr.join('');
	},

	/**
	 * Parses the provided string and inserts a breaking character on place
	 * where string is going to overrun the provided container's width.
	 * 
	 * @param txt
	 *            the text that is containing in the current element
	 * @param the
	 *            width of the current element
	 * @return the string that is already hyphenated so to match the width of
	 *         the containing element
	 */
	breakString : function(txt, eleWidth) {
		var txtLength = txt.length;
		var resultStr = '';
		var sum = 0;
		var lineContainsWBRChar = false;
		var resetWBRFlag = false;
		var ch, increment;
		for ( var i = 0; i < txtLength; i++) {
			ch = txt.substring(i, i + 1);
			// flag that shows if any word breaking char is found on the current
			// row
			lineContainsWBRChar = false;

			// if current sign is a word-breacking one we notice that in
			// order to know whether to insert breaking char when we reach
			// to the end of the line (sum >= eleWidth)
			if (ch in this.WBR_CHARS) {
				lineContainsWBRChar = true;
				sum = 0;
			}

			// if '<' sign is found assume that it is a beginning of a tag so we
			// need to check if it is one of the following that should not be
			// processed and if it is we just attach the found tag to the result
			// and continue the processing of the string after the tag
			// TODO NEED OPTIMIZATION
			if (ch.charCodeAt(0) == 60) {
				if ((txt.charCodeAt(i + 1) == 98 || txt.charCodeAt(i + 1) == 66)
						&& (txt.charCodeAt(i + 2) == 62)) {
					i += 2;
					resultStr += '<b>';
					continue;
				} else if ((txt.charCodeAt(i + 1) == 47)
						&& (txt.charCodeAt(i + 2) == 98 || txt
								.charCodeAt(i + 2) == 66)
						&& (txt.charCodeAt(i + 3) == 62)) {
					i += 3;
					resultStr += '</b>';
					continue;
				} else if ((txt.charCodeAt(i + 1) == 87 || txt
						.charCodeAt(i + 1) == 119)
						&& (txt.charCodeAt(i + 2) == 98 || txt
								.charCodeAt(i + 2) == 66)
						&& (txt.charCodeAt(i + 3) == 82 || txt
								.charCodeAt(i + 3) == 114)
						&& (txt.charCodeAt(i + 4) == 62)) {
					i += 4;
					// skip not append!!!
					// resultStr += '<wbr>';
					continue;
				}
				// TODO implement skip for <shy>
			}

			// if calculated sum is going to overrun the provided width we need
			// to hyphenate but if we have found a breacking char earlier on the
			// same row we doesn't inject a breaking char and rely on the
			// browser
			// to hyphenate (if it wants to)
			// FIXME there is an issue under FF3 where it doesn't hyphenate
			// properly
			increment = this.allSigns[ch.charCodeAt(0) - 32] + this.LETT_SPACE;
			if ((sum + increment) >= eleWidth) {
				// if there isn't breaking char on the row we inject word
				// breaking char
				if (!lineContainsWBRChar) {
					// insert breaking character
					resultStr += this.HYPHEN_TYPE;
					// clear the sum to start a new row
					sum = 0;
				}
			}

			// 32 - UTF8 for 'space', 1103 - UTF8 for 'who knows'
			if (ch.charCodeAt(0) >= 32 && ch.charCodeAt(0) <= 1103) {
				// increment the sum with the width of the current sign + letter
				// space
				sum += increment;
			}

			// append the current char to the resulting string
			resultStr += ch;
		}
		return resultStr;
	},

	/**
	 * Calculates the font-size applied on the provided tag.
	 * 
	 * @param the
	 *            tag to get its fonts size
	 * @return the calculated font size in pixels on the provided tag
	 */
	getFontSize : function(rootTag) {
		var fSize = (rootTag.currentStyle
				|| (window.getComputedStyle && getComputedStyle(rootTag, null)) || rootTag.style).fontSize;
		return fSize.substring(0, (fSize.length - 2));
	},

	/**
	 * 
	 */
	prepareCharWidths : function(currentFontSize) {
		switch (currentFontSize * 1) {
		case 8:
			this.allSigns = this.fSize8;
			break;
		case 9:
			this.allSigns = this.fSize9;
			break;
		case 10:
			this.allSigns = this.fSize10;
			break;
		case 11:
			this.allSigns = this.fSize11;
			break;
		case 12:
			this.allSigns = this.fSize12;
			break;
		case 13:
			this.allSigns = this.fSize13;
			break;
		case 14:
			this.allSigns = this.fSize14;
			break;
		case 15:
			this.allSigns = this.fSize15;
			break;
		case 16:
			this.allSigns = this.fSize16;
			break;

		default:
			this.allSigns = this.fSize12;
			break;
		}
	},

	/**
	 * 
	 */
	initCalculation : function (neededFSize) {
        var generateAll = false;
        if (!neededFSize) {
          return;
        } 
        if (neededFSize == 'all') {
          generateAll = true;
        } else {
          if (neededFSize < 6 || neededFSize > 32) {
            alert('Font size argument is reqired!');
            return;
          }    
        }
    
		var elDiv = document.createElement('div');
		elDiv.id = 'elDiv';
		elDiv.setAttribute('class', 'printOut');
		elDiv.setAttribute('className', 'printOut');
		document.body.appendChild(elDiv);
    
		//var containerSpan = document.createElement('span');
		//document.body.appendChild(containerSpan);
        var containerSpan = document.getElementById('tester');    
            
        if (generateAll) {
          for (var i = 8; i <= 16; i++) {
            containerSpan.style.fontSize = i + 'px';
            this.calculateWidth(i, containerSpan, elDiv);
          }
        } else {
          containerSpan.style.fontSize = neededFSize + 'px';
          this.calculateWidth(neededFSize, containerSpan, elDiv);
        }
        this.print('elDiv', '<hr \>END!', 1);
	},

	/**
	 * Helper function that may be used to calculate the letters width.
	 */
	calculateWidth : function (neededFSize, testerEl, outputEl) {

		var chWidth = 0;
        this.print('elDiv', 'fSize' + neededFSize + ':[', 1);
        // 32 - 1103
            //for (var i = 32; i <= 1103; i++) {
            for (var i = 32; i <= 36; i++) {
                testerEl.innerHTML = String.fromCharCode(i);
                chWidth = testerEl.offsetWidth + ', ';
                this.print('elDiv', chWidth, 1);
            }
        this.print('elDiv', '],', 1);
	},

	/**
	 * Helper method that prints in the html page.
	 */
	print : function (id, txt, append) {
		if (append) {
			document.getElementById(id).innerHTML += txt;
		} else {
			document.getElementById('print').innerHTML = txt;
		}
	},    

	/**
	 * Тhe widths of the signs from 32 to 1103 UTF8 for 12px font-size.
	 */
	allSigns : [],

	fSize8 : [ 0, 3, 3, 4, 4, 7, 5, 2, 3, 3, 3, 5, 2, 3, 2, 2, 4, 4, 4, 4, 4,
			4, 4, 4, 4, 4, 2, 2, 5, 5, 5, 4, 8, 5, 5, 6, 6, 5, 5, 6, 6, 2, 4,
			5, 4, 7, 6, 6, 5, 6, 6, 5, 5, 6, 5, 7, 5, 5, 5, 2, 2, 2, 3, 4, 3,
			4, 4, 4, 4, 4, 2, 5, 4, 2, 2, 3, 2, 6, 4, 4, 4, 5, 3, 4, 2, 4, 3,
			5, 3, 3, 4, 3, 3, 3, 5, 13, 13, 13, 13, 13, 13, 0, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 2, 3, 4, 4, 4, 4, 3, 4, 3, 6, 3, 4, 5, 0, 6, 4,
			3, 4, 3, 3, 3, 5, 4, 2, 3, 3, 3, 4, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5,
			8, 6, 5, 5, 5, 5, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6,
			6, 5, 5, 5, 4, 4, 4, 4, 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, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 4, 5, 5, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 5, 4, 2,
			4, 4, 5, 4, 5, 4, 4, 4, 2, 2, 2, 3, 2, 2, 5, 7, 7, 7, 4, 4, 4, 4,
			6, 6, 4, 3, 3, 3, 3, 3, 2, 2, 4, 4, 4, 2, 2, 2, 4, 2, 2, 4, 5, 4,
			4, 6, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 4, 4, 5, 4, 3, 4, 3, 4, 4,
			4, 8, 7, 8, 6, 4, 6, 6, 5, 5, 4, 5, 13, 13, 3, 3, 2, 2, 2, 3, 3, 4,
			3, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 4, 5, 1, 5,
			5, 5, 3, 3, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3, 4, 3, 2, 13, 3, 1, 3, 3,
			3, 4, 4, 4, 4, 4, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 3, 3, 13, 13, 13, 13, 5, 13, 13, 13, 2, 13,
			13, 13, 13, 13, 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, 6, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
			4, 3, 4, 5, 6, 3, 7, 7, 7, 5, 5, 3, 3, 5, 5, 5, 5, 4, 4, 4, 4, 4,
			4, 3, 13, 4, 2, 4, 5, 4, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 13, 13, 13,
			13, 7, 13, 13, 13, 3, 13, 13, 13, 13, 13, 4, 4, 8, 3, 9, 9, 5, 13,
			9, 13, 10, 8, 2, 8, 7, 6, 8, 6, 7, 7, 8, 2, 7, 8, 8, 7, 7, 8, 7, 6,
			13, 7, 6, 8, 8, 7, 8, 8, 2, 8, 6, 5, 6, 2, 6, 6, 6, 6, 6, 5, 5, 6,
			6, 2, 6, 6, 6, 6, 5, 6, 9, 6, 5, 7, 4, 6, 7, 5, 8, 8, 2, 6, 6, 6,
			8, 13, 6, 6, 8, 10, 8, 6, 8, 6, 9, 6, 8, 6, 7, 5, 7, 6, 8, 6, 9, 9,
			8, 6, 8, 6, 7, 7, 7, 7, 8, 6, 5, 5, 6, 6, 6, 2, 8, 5, 5, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 6, 6, 10, 6, 7, 7, 2, 2, 5, 12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, 9, 8, 7, 4, 4, 4, 4, 4, 3, 3, 6, 6, 6, 3,
			4, 3, 5, 3, 3, 7, 7, 6, 6, 9, 6, 6, 6, 7, 5, 6, 6, 6, 6, 6, 9, 7,
			6, 7, 7, 5, 6, 5, 7, 6, 6, 11, 11, 12, 9, 5, 9, 9, 8, 7, 6, 7, 13,
			13, 5, 5, 3, 3, 3, 4, 4, 6, 4, 7, 6, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
			5, 4, 4, 3, 4, 5, 7, 3, 7, 7, 7, 5, 5, 3, 3, 6, 6, 6, 6, 4, 4, 4,
			4, 4, 4, 3, 13, 5, 2, 4, 5, 4, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 4, 4, 13, 13,
			13, 13, 7, 13, 13, 13, 3, 13, 13, 13, 13, 13, 4, 4, 7, 3, 9, 10, 4,
			13, 9, 13, 9, 9, 3, 7, 8, 7, 7, 8, 7, 9, 9, 3, 8, 7, 9, 9, 8, 9, 9,
			8, 13, 7, 7, 7, 9, 7, 9, 9, 3, 7, 7, 5, 7, 3, 7, 7, 7, 5, 7, 5, 5,
			7, 7, 3, 7, 5, 7, 5, 5, 7, 8, 7, 6, 7, 5, 7, 8, 6, 9, 9, 3, 7, 7,
			7, 9, 13, 7, 7, 9, 11, 9, 7, 8, 7, 9, 7, 9, 6, 7, 6, 8, 6, 9, 7,
			10, 10, 8, 7, 8, 6, 8, 8, 7, 7, 9, 7, 6, 5, 7, 7, 6, 3, 9, 6, 6,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 7, 8, 10, 7, 9, 8, 3, 3, 6, 13,
			12, 10, 7, 8, 8, 9, 7, 8, 8, 7, 8, 8, 11, 7, 9, 9, 7, 8, 9, 9, 9,
			9, 8, 9, 7, 8, 9, 7, 9, 8, 11, 11, 10, 10, 8, 9, 12, 9, 7, 7, 6, 4,
			7, 7, 9, 6, 7, 7, 6, 7, 9, 7, 7, 7, 7, 6, 5, 5, 9, 5, 7, 6, 9, 9,
			8, 9, 7, 6, 9, 7 ],

	fSize13 : [ 0, 3, 5, 7, 7, 12, 9, 2, 4, 4, 5, 8, 4, 4, 4, 4, 7, 7, 7, 7, 7,
			7, 7, 7, 7, 7, 4, 4, 8, 8, 8, 7, 13, 9, 9, 9, 9, 9, 8, 10, 9, 3, 6,
			9, 7, 11, 9, 10, 9, 10, 9, 9, 7, 9, 9, 13, 7, 9, 7, 4, 4, 4, 5, 7,
			4, 7, 7, 7, 7, 7, 3, 7, 7, 3, 3, 7, 3, 11, 7, 7, 7, 7, 4, 7, 4, 7,
			5, 9, 7, 7, 7, 4, 3, 4, 8, 13, 13, 13, 13, 13, 13, 0, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 4, 3, 7, 7, 7, 7, 3, 7, 4, 10, 4, 7, 8, 0,
			10, 7, 5, 7, 4, 4, 4, 7, 7, 4, 4, 4, 5, 7, 11, 11, 11, 8, 9, 9, 9,
			9, 9, 9, 13, 9, 9, 9, 9, 9, 3, 3, 3, 3, 9, 9, 10, 10, 10, 10, 10,
			8, 10, 9, 9, 9, 9, 9, 9, 9, 7, 7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, 9, 7, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 10, 7, 8, 9, 7, 4, 7,
			8, 8, 7, 8, 7, 7, 7, 3, 3, 3, 4, 4, 3, 7, 11, 11, 11, 7, 7, 7, 8,
			9, 9, 7, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 5, 4, 4, 6, 4, 4, 7, 8, 7,
			7, 9, 7, 6, 7, 7, 6, 6, 7, 7, 7, 7, 10, 8, 7, 8, 8, 5, 7, 6, 7, 7,
			7, 12, 12, 13, 9, 6, 10, 10, 9, 8, 6, 7, 13, 13, 5, 5, 3, 3, 3, 4,
			4, 6, 4, 6, 6, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 4, 4, 3, 4, 7, 8,
			3, 7, 7, 7, 5, 5, 3, 3, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 3, 13, 5, 2,
			4, 5, 4, 5, 5, 5, 5, 5, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 4, 4, 13, 13, 13, 13, 7, 13, 13, 13, 4,
			13, 13, 13, 13, 13, 4, 4, 9, 3, 10, 11, 5, 13, 10, 13, 11, 10, 3,
			9, 9, 7, 9, 9, 7, 9, 10, 3, 9, 9, 11, 9, 8, 10, 9, 9, 13, 8, 7, 9,
			9, 7, 9, 10, 3, 9, 8, 6, 7, 3, 7, 8, 7, 7, 7, 6, 6, 7, 7, 3, 7, 7,
			7, 5, 6, 7, 9, 7, 6, 8, 5, 7, 8, 7, 9, 9, 3, 7, 7, 7, 9, 13, 7, 7,
			9, 12, 9, 7, 9, 7, 10, 7, 9, 7, 8, 6, 8, 7, 10, 8, 11, 11, 9, 7, 9,
			7, 9, 9, 8, 8, 10, 7, 6, 5, 7, 7, 7, 3, 10, 6, 6, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 7, 9, 11, 7, 9, 9, 3, 3, 6, 14, 13, 11, 8, 8,
			8, 9, 9, 9, 9, 7, 9, 9, 11, 8, 9, 9, 8, 9, 11, 9, 10, 9, 9, 9, 7,
			8, 11, 7, 10, 9, 11, 11, 10, 11, 8, 9, 13, 9, 7, 7, 7, 5, 8, 7, 9,
			6, 7, 7, 6, 7, 9, 7, 7, 7, 7, 7, 5, 7, 9, 7, 7, 7, 11, 12, 8, 9, 7,
			7, 10, 7 ],

	fSize14 : [ 0, 5, 5, 8, 8, 12, 9, 3, 5, 5, 5, 8, 4, 5, 4, 4, 8, 8, 8, 8, 8,
			8, 8, 8, 8, 8, 4, 4, 8, 8, 8, 8, 14, 9, 9, 10, 10, 9, 9, 11, 9, 3,
			6, 9, 8, 11, 9, 11, 9, 11, 10, 9, 9, 9, 9, 13, 8, 9, 8, 4, 4, 4, 5,
			8, 5, 8, 8, 7, 8, 8, 4, 8, 8, 3, 3, 7, 3, 11, 8, 8, 8, 8, 5, 7, 4,
			8, 7, 9, 6, 7, 6, 5, 3, 5, 8, 13, 13, 13, 13, 13, 13, 0, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 4, 5, 8, 8, 8, 8, 3, 8, 5, 10, 4, 8, 8,
			0, 10, 8, 6, 8, 5, 5, 5, 8, 8, 4, 5, 5, 5, 8, 12, 12, 12, 9, 9, 9,
			9, 9, 9, 9, 14, 10, 9, 9, 9, 9, 4, 4, 4, 4, 10, 10, 11, 11, 11, 11,
			11, 8, 11, 10, 10, 10, 10, 9, 9, 9, 8, 8, 8, 8, 8, 8, 12, 7, 8, 8,
			8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 8, 7,
			9, 8, 9, 8, 9, 8, 10, 7, 10, 7, 10, 7, 10, 7, 10, 9, 10, 8, 9, 8,
			9, 8, 9, 8, 9, 8, 9, 8, 11, 8, 11, 8, 11, 8, 11, 8, 9, 8, 9, 8, 3,
			3, 3, 3, 3, 3, 3, 3, 3, 3, 10, 6, 6, 3, 9, 7, 7, 8, 3, 8, 3, 8, 4,
			8, 5, 8, 3, 9, 8, 9, 8, 9, 8, 8, 10, 8, 11, 8, 11, 8, 11, 8, 14,
			13, 10, 5, 10, 5, 10, 5, 9, 7, 9, 7, 9, 7, 9, 7, 9, 4, 9, 5, 9, 4,
			9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 10, 8, 13, 9, 9, 7, 9, 8, 6, 8, 6, 8,
			6, 3, 8, 10, 9, 8, 9, 8, 10, 10, 7, 10, 11, 9, 8, 8, 9, 11, 9, 9,
			8, 11, 9, 13, 3, 4, 9, 7, 3, 7, 12, 10, 8, 11, 12, 9, 12, 10, 10,
			8, 9, 9, 7, 9, 6, 4, 9, 4, 9, 12, 9, 11, 10, 11, 7, 9, 7, 7, 8, 7,
			7, 8, 8, 6, 8, 8, 3, 3, 10, 3, 18, 17, 15, 15, 11, 6, 17, 13, 11,
			9, 8, 3, 3, 11, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 8, 8, 9, 8, 9, 8, 14,
			13, 9, 8, 9, 8, 8, 7, 10, 8, 11, 8, 7, 6, 3, 18, 17, 15, 11, 8, 15,
			8, 10, 8, 9, 8, 14, 12, 11, 8, 9, 8, 9, 8, 9, 8, 9, 8, 3, 3, 3, 3,
			11, 8, 11, 8, 10, 5, 10, 5, 10, 8, 10, 8, 8, 6, 8, 5, 7, 6, 10, 8,
			10, 13, 8, 7, 9, 7, 9, 8, 8, 7, 11, 8, 11, 8, 11, 8, 11, 8, 9, 7,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 8, 8, 8, 7, 7, 8, 8,
			8, 8, 10, 7, 7, 9, 7, 4, 8, 8, 8, 7, 9, 8, 8, 8, 3, 3, 3, 5, 4, 3,
			8, 12, 12, 12, 8, 8, 8, 8, 10, 10, 8, 5, 5, 5, 5, 5, 4, 4, 7, 7, 7,
			5, 4, 4, 6, 4, 4, 8, 8, 7, 7, 10, 7, 7, 7, 8, 6, 7, 7, 7, 7, 7, 11,
			7, 7, 8, 8, 5, 7, 6, 8, 7, 7, 13, 12, 14, 10, 6, 11, 11, 9, 9, 7,
			8, 13, 13, 5, 5, 3, 4, 4, 4, 5, 7, 5, 7, 7, 4, 4, 4, 4, 4, 5, 5, 6,
			6, 6, 6, 5, 5, 3, 5, 7, 9, 3, 9, 9, 9, 6, 6, 4, 4, 7, 7, 7, 7, 5,
			5, 5, 5, 4, 5, 4, 13, 5, 3, 5, 6, 5, 6, 6, 6, 6, 6, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 13,
			13, 13, 13, 9, 13, 13, 13, 4, 13, 13, 13, 13, 13, 5, 5, 9, 3, 11,
			11, 5, 13, 11, 13, 11, 11, 3, 9, 9, 8, 9, 9, 8, 9, 11, 3, 9, 9, 11,
			9, 9, 11, 9, 9, 13, 9, 9, 9, 11, 8, 11, 11, 3, 9, 8, 7, 8, 3, 8, 8,
			8, 7, 8, 7, 6, 8, 8, 3, 7, 7, 8, 7, 6, 8, 10, 8, 7, 9, 5, 8, 9, 7,
			9, 11, 3, 8, 8, 8, 11, 13, 8, 8, 10, 13, 10, 8, 10, 8, 11, 8, 10,
			7, 9, 7, 9, 7, 11, 8, 12, 12, 10, 8, 10, 8, 9, 9, 9, 9, 10, 8, 7,
			6, 8, 8, 7, 3, 11, 7, 7, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 9,
			12, 8, 10, 9, 3, 3, 6, 15, 14, 12, 8, 9, 9, 10, 9, 9, 9, 8, 9, 9,
			13, 8, 10, 10, 8, 9, 11, 9, 11, 9, 9, 10, 9, 9, 11, 8, 10, 8, 13,
			13, 11, 11, 9, 10, 14, 10, 8, 8, 7, 5, 8, 8, 9, 6, 8, 8, 6, 8, 10,
			8, 8, 8, 8, 7, 7, 7, 11, 6, 9, 7, 11, 11, 9, 10, 8, 7, 11, 8 ],

	fSize15 : [ 0, 5, 5, 8, 8, 13, 10, 3, 5, 5, 6, 9, 4, 5, 4, 4, 8, 8, 8, 8,
			8, 8, 8, 8, 8, 8, 4, 4, 9, 9, 9, 8, 15, 9, 10, 11, 11, 10, 9, 11,
			10, 3, 7, 10, 8, 11, 10, 12, 10, 12, 11, 10, 9, 10, 9, 15, 9, 9, 8,
			4, 4, 4, 5, 8, 5, 8, 8, 8, 8, 8, 4, 8, 8, 3, 3, 7, 3, 13, 8, 8, 8,
			8, 5, 8, 4, 8, 7, 11, 7, 7, 8, 5, 3, 5, 9, 13, 13, 13, 13, 13, 13,
			0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 4, 5, 8, 8, 8, 8, 3, 8, 5,
			11, 5, 8, 9, 0, 11, 8, 6, 8, 5, 5, 5, 8, 8, 4, 5, 5, 5, 8, 13, 13,
			13, 9, 9, 9, 9, 9, 9, 9, 15, 11, 10, 10, 10, 10, 3, 3, 3, 3, 11,
			10, 12, 12, 12, 12, 12, 9, 12, 10, 10, 10, 10, 9, 10, 9, 8, 8, 8,
			8, 8, 8, 13, 8, 8, 8, 8, 8, 3, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8, 8,
			8, 8, 8, 8, 7, 8, 7, 9, 8, 9, 8, 9, 8, 11, 8, 11, 8, 11, 8, 11, 8,
			11, 9, 11, 8, 10, 8, 10, 8, 10, 8, 10, 8, 10, 8, 11, 8, 11, 8, 11,
			8, 11, 8, 10, 8, 10, 8, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 11, 7, 7, 3,
			10, 7, 8, 8, 3, 8, 3, 8, 4, 8, 5, 8, 3, 10, 8, 10, 8, 10, 8, 9, 11,
			8, 12, 8, 12, 8, 12, 8, 15, 14, 11, 5, 11, 5, 11, 5, 10, 8, 10, 8,
			10, 8, 10, 8, 9, 4, 9, 6, 9, 4, 10, 8, 10, 8, 10, 8, 10, 8, 10, 8,
			11, 8, 15, 11, 9, 7, 9, 8, 8, 8, 8, 8, 8, 3, 8, 11, 10, 8, 10, 8,
			11, 11, 8, 11, 12, 10, 8, 8, 10, 11, 10, 9, 8, 12, 10, 13, 3, 4,
			10, 8, 3, 8, 13, 11, 8, 12, 13, 10, 13, 11, 11, 8, 10, 10, 8, 9, 6,
			4, 9, 4, 9, 13, 10, 12, 11, 12, 8, 9, 8, 8, 8, 7, 7, 8, 8, 7, 8, 8,
			5, 5, 11, 3, 19, 18, 16, 16, 12, 6, 18, 14, 11, 9, 8, 3, 3, 12, 8,
			10, 8, 10, 8, 10, 8, 10, 8, 10, 8, 8, 9, 8, 9, 8, 15, 13, 10, 8,
			10, 8, 9, 7, 11, 8, 12, 9, 8, 7, 3, 19, 18, 16, 12, 8, 16, 8, 11,
			8, 9, 8, 15, 13, 12, 8, 9, 8, 9, 8, 10, 8, 10, 8, 3, 3, 3, 3, 12,
			9, 12, 9, 11, 5, 11, 5, 11, 8, 11, 8, 8, 7, 10, 5, 8, 6, 11, 8, 10,
			13, 9, 8, 9, 8, 9, 8, 8, 8, 12, 9, 12, 9, 12, 9, 12, 9, 9, 7, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 8, 9, 9, 8, 8, 8, 8, 8, 8,
			8, 11, 8, 8, 10, 8, 4, 8, 8, 9, 8, 9, 8, 8, 8, 3, 4, 3, 5, 4, 3, 8,
			13, 13, 13, 8, 8, 8, 8, 11, 10, 8, 5, 5, 5, 5, 5, 4, 4, 8, 8, 8, 5,
			4, 4, 7, 4, 4, 8, 9, 8, 8, 11, 8, 7, 8, 8, 7, 7, 8, 8, 8, 8, 12, 8,
			8, 9, 8, 6, 8, 6, 8, 8, 8, 14, 13, 15, 11, 7, 11, 11, 10, 9, 7, 8,
			13, 13, 6, 6, 4, 4, 4, 5, 5, 7, 5, 8, 8, 5, 5, 5, 5, 5, 5, 5, 6, 6,
			6, 6, 5, 5, 3, 5, 8, 9, 3, 9, 9, 9, 6, 6, 4, 4, 7, 7, 7, 7, 5, 5,
			5, 5, 4, 5, 4, 13, 6, 3, 5, 6, 5, 7, 7, 7, 7, 7, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 13,
			13, 13, 13, 9, 13, 13, 13, 4, 13, 13, 13, 13, 13, 5, 5, 9, 3, 12,
			13, 6, 13, 12, 13, 12, 11, 3, 9, 10, 8, 10, 10, 8, 10, 12, 3, 10,
			11, 11, 10, 10, 12, 10, 10, 13, 9, 9, 9, 11, 9, 11, 11, 3, 9, 9, 7,
			8, 3, 8, 9, 9, 7, 8, 7, 7, 8, 8, 3, 8, 7, 8, 7, 7, 8, 10, 8, 7, 9,
			5, 8, 10, 8, 11, 12, 3, 8, 8, 8, 12, 13, 8, 8, 11, 14, 11, 8, 10,
			9, 12, 8, 11, 8, 9, 7, 9, 8, 11, 9, 13, 13, 10, 8, 10, 8, 10, 10,
			9, 9, 11, 8, 7, 6, 9, 9, 8, 3, 12, 7, 7, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 8, 10, 13, 8, 11, 10, 3, 3, 7, 16, 15, 13, 9, 10, 10,
			11, 9, 10, 10, 8, 10, 10, 14, 9, 11, 11, 9, 10, 11, 10, 12, 10, 10,
			11, 9, 10, 11, 9, 11, 9, 14, 15, 12, 13, 10, 11, 15, 11, 8, 9, 8,
			5, 9, 8, 9, 7, 8, 8, 7, 8, 10, 8, 8, 8, 8, 8, 7, 7, 11, 7, 9, 8,
			11, 11, 9, 11, 8, 8, 11, 8 ],

	fSize16 : [ 0, 5, 6, 9, 9, 14, 11, 3, 5, 5, 6, 9, 4, 5, 4, 4, 9, 9, 9, 9,
			9, 9, 9, 9, 9, 9, 4, 4, 9, 9, 9, 9, 16, 11, 11, 12, 12, 11, 10, 12,
			11, 3, 8, 11, 9, 13, 11, 12, 11, 12, 11, 11, 9, 11, 11, 15, 11, 9,
			9, 4, 4, 4, 7, 9, 5, 9, 9, 8, 9, 9, 4, 9, 8, 4, 3, 8, 3, 13, 8, 9,
			9, 9, 5, 8, 4, 8, 7, 11, 7, 7, 7, 5, 3, 5, 9, 13, 13, 13, 13, 13,
			13, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 4, 5, 9, 9, 9, 9, 3, 9,
			5, 12, 5, 9, 9, 0, 12, 9, 6, 9, 5, 5, 5, 9, 9, 4, 5, 5, 5, 9, 13,
			13, 13, 10, 11, 11, 11, 11, 11, 11, 16, 12, 11, 11, 11, 11, 3, 3,
			3, 3, 12, 11, 12, 12, 12, 12, 12, 9, 12, 11, 11, 11, 11, 9, 11, 9,
			9, 9, 9, 9, 9, 9, 14, 8, 9, 9, 9, 9, 3, 3, 3, 3, 9, 8, 9, 9, 9, 9,
			9, 9, 9, 8, 8, 8, 8, 7, 9, 7, 11, 9, 11, 9, 11, 9, 12, 8, 12, 8,
			12, 8, 12, 8, 12, 10, 12, 9, 11, 9, 11, 9, 11, 9, 11, 9, 11, 9, 12,
			9, 12, 9, 12, 9, 12, 9, 11, 8, 11, 8, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3,
			12, 7, 8, 3, 11, 8, 8, 9, 3, 9, 3, 9, 4, 9, 5, 9, 3, 11, 8, 11, 8,
			11, 8, 10, 12, 9, 12, 9, 12, 9, 12, 9, 17, 15, 11, 5, 11, 5, 11, 5,
			11, 8, 11, 8, 11, 8, 11, 8, 9, 4, 9, 6, 10, 4, 11, 8, 11, 8, 11, 8,
			11, 8, 11, 8, 12, 8, 15, 11, 9, 7, 9, 9, 7, 9, 7, 9, 7, 3, 9, 12,
			11, 9, 10, 9, 12, 12, 8, 12, 13, 10, 9, 9, 11, 12, 10, 10, 9, 12,
			11, 14, 3, 4, 11, 8, 3, 8, 13, 12, 9, 12, 14, 11, 14, 11, 12, 9,
			11, 11, 8, 11, 7, 4, 10, 4, 10, 14, 11, 12, 12, 12, 8, 10, 8, 9, 9,
			8, 8, 9, 9, 7, 9, 9, 5, 5, 12, 4, 21, 19, 17, 17, 13, 7, 19, 14,
			12, 11, 9, 3, 4, 12, 9, 11, 8, 11, 8, 11, 8, 11, 8, 11, 8, 9, 11,
			9, 11, 9, 16, 15, 11, 9, 11, 9, 9, 8, 12, 9, 12, 9, 9, 7, 3, 21,
			19, 17, 13, 9, 17, 9, 11, 9, 11, 9, 16, 14, 12, 9, 11, 9, 11, 9,
			11, 9, 11, 9, 5, 3, 5, 3, 12, 9, 12, 9, 12, 5, 12, 5, 12, 9, 12, 9,
			9, 7, 10, 5, 8, 7, 12, 9, 11, 13, 9, 9, 10, 8, 11, 9, 9, 8, 12, 9,
			12, 9, 12, 9, 12, 9, 11, 7, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 9, 9, 9, 9, 8, 8, 9, 9, 9, 9, 12, 8, 8, 11, 9, 5, 9, 9, 9, 8,
			10, 9, 9, 9, 3, 4, 3, 5, 5, 3, 9, 13, 13, 13, 9, 9, 9, 9, 12, 11,
			9, 5, 5, 5, 5, 5, 4, 4, 9, 9, 8, 5, 5, 4, 7, 4, 4, 9, 10, 8, 8, 12,
			8, 8, 8, 9, 7, 8, 8, 8, 8, 8, 12, 9, 9, 9, 9, 6, 8, 7, 9, 8, 8, 15,
			14, 16, 11, 7, 12, 12, 11, 10, 8, 9, 13, 13, 6, 6, 4, 4, 4, 5, 6,
			8, 5, 7, 8, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 5, 5, 3, 5, 8, 10, 3,
			10, 10, 10, 7, 7, 5, 5, 8, 8, 8, 8, 5, 5, 5, 5, 4, 5, 4, 13, 6, 3,
			6, 7, 5, 7, 7, 7, 7, 7, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
			0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
			13, 13, 13, 13, 13, 13, 13, 5, 5, 13, 13, 13, 13, 10, 13, 13, 13,
			4, 13, 13, 13, 13, 13, 5, 5, 11, 3, 13, 13, 6, 13, 12, 13, 12, 12,
			3, 11, 11, 9, 11, 11, 9, 11, 12, 3, 11, 11, 13, 11, 10, 12, 11, 11,
			13, 10, 9, 9, 11, 11, 11, 12, 3, 9, 9, 7, 8, 3, 8, 9, 9, 8, 9, 7,
			7, 8, 9, 3, 8, 8, 9, 7, 7, 9, 11, 9, 8, 10, 5, 8, 10, 8, 11, 13, 3,
			8, 9, 8, 13, 13, 9, 9, 12, 15, 12, 9, 11, 9, 12, 9, 12, 8, 10, 8,
			10, 8, 12, 9, 13, 13, 11, 9, 11, 9, 11, 11, 10, 10, 12, 9, 8, 7, 9,
			9, 8, 3, 12, 7, 7, 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 11, 14,
			9, 12, 11, 3, 3, 8, 17, 16, 13, 9, 11, 10, 12, 11, 11, 11, 9, 11,
			11, 14, 10, 12, 12, 9, 11, 13, 11, 12, 11, 11, 12, 9, 10, 11, 11,
			12, 10, 13, 14, 13, 14, 11, 12, 16, 12, 9, 9, 9, 6, 9, 9, 10, 7, 8,
			8, 7, 8, 11, 8, 9, 8, 9, 8, 7, 7, 13, 7, 9, 8, 11, 11, 10, 12, 9,
			8, 12, 9 ]
};

/**
 * Trims on the left and right the provided string. It is included as method in
 * String object.
 * 
 * @returns the string trimmed
 */
String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g, "");
};